package cn.bdqn.page1;

import java.util.Iterator;
import java.util.Scanner;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import cn.bdqn.yemian.PageLandSecond;

/**
 * 用户登录类
 */
public class Land {
	// 因为所有的方法都需要DOM树
	static Document document = null;
	static Element root = null;

	// 用户登录方法
	public void land() throws Exception {
		Scanner input = new Scanner(System.in);
		SAXReader reader = new SAXReader();
		document = reader.read("UserMessage.xml");
		root = (Element) document.getRootElement();
		System.out.print("请输入手机号码：");
		String phone = input.next();
		phone = phone.trim();
		System.out.print("请输入密码：");
		Iterator itUser = root.elementIterator();
		while (itUser.hasNext()) {
			Element user = (Element) itUser.next();
			String pwd = input.next();
			pwd = pwd.trim();
			// 转向二级菜单页面
			PageLandSecond pls = new PageLandSecond();
			pls.showInfo(phone);
			return;

		}

	}
}
